<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="jakarta.faces.core" xmlns:ui="jakarta.faces.facelets"
    xmlns:p="http://primefaces.org/ui" template="/template_pop.xhtml" xmlns:h="jakarta.faces.html">
    <ui:define name="content">
        <title>#{sysOrgMBean.editObj.id ==null ? sms['button.new'] : sms['button.edit']}#{sms['sys.org.title']}</title>
        <h:inputHidden value="#{sysOrgMBean.editObj.id}" />
        <!--<p:growl id="growl" showDetail="true" />-->
        <div class="field grid">
            <p:outputLabel for="parent" class="col-fixed" style="width:100px" dir="RTL">#{sms['sys.org.parent']}
            </p:outputLabel>
            <div class="col">
                <p:inputText id="parent" value="#{sysOrgMBean.editObj.parent.name}" required="true" readonly="true">
                </p:inputText>
                <p:message for="@previous" />
            </div>
        </div>
        <div class="field grid">
            <p:outputLabel for="name" class="col-fixed" style="width:100px" dir="RTL">#{sms['sys.org.name']}
            </p:outputLabel>
            <div class="col">
                <p:inputText id="name" value="#{sysOrgMBean.editObj.name}" required="true">

                    <f:validateLength minimum="2" maximum="50" />
                    <p:clientValidator event="keyup" />

                </p:inputText>
                <p:message for="@previous" />
            </div>

        </div>
        <div class="field grid">
            <p:outputLabel for="level" class="col-fixed" style="width:100px" dir="RTL">#{sms['sys.org.level']}
            </p:outputLabel>
            <div class="col">
                <p:inputText id="level" value="#{sysOrgMBean.editObj.level}" required="true">
                </p:inputText>
                <p:message for="@previous" />
            </div>

        </div>
        <div class="field grid">
            <p:outputLabel for="formal" class="col-fixed" style="width:100px" dir="RTL">#{sms['sys.org.formal']}
            </p:outputLabel>
            <div class="col">
                <p:selectBooleanCheckbox value="#{sysOrgMBean.editObj.formal}" id="formal" />
                <p:message for="@previous" />
            </div>

        </div>
        <div class="field grid">
            <p:outputLabel for="state" class="col-fixed" style="width:100px" dir="RTL">#{sms['sys.org.state']}
            </p:outputLabel>
            <div class="col">
                <p:selectBooleanCheckbox value="#{sysOrgMBean.editObj.state}" id="state" />
                <p:message for="@previous" />
            </div>

        </div>


        <br />

        <div class="flex">
            <p:commandButton value="#{sms['button.submit']}" update="@form" type="submit" validateClient="true"
                ajax="true" action="#{sysOrgMBean.save}" class="flex-2 border-round mx-4">

            </p:commandButton>
            <p:commandButton value="#{sms['button.cancel']}" action="#{sysOrgMBean.closeDialog()}"
                class="flex-2 border-round mx-4" rendered="#{sysOrgMBean.editObj.id!=null}">

            </p:commandButton>


        </div>


    </ui:define>
</ui:composition>